﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sql_c
{
    class Program
    {
        static void Main(string[] args)
        {


            /*
            string adress = "server=.;database=demo;uid=sa;pwd=123456789";
            SqlConnection sconn = new SqlConnection(adress);

            sconn.Open();

            string scomm = "insert into userInfo values ('刘先生','123456','ddd')";
            SqlCommand scmd = new SqlCommand(scomm,sconn);
            int i = scmd.ExecuteNonQuery();
            sconn.Close();

            string scomm = "select * from userInfo";
            SqlCommand scmd = new SqlCommand(scomm,sconn);
            SqlDataReader sdr = scmd.ExecuteReader();
            while (sdr.Read())
            {
                string userName = (string)sdr["userName"];
            }
            */

            Console.WriteLine("输入性别");
            string sex = Console.ReadLine();
            DataTable dt = new UserInfoDal().ReferBySex(sex);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr = dt.Rows[i];
                string userName = (string)dr["userName"];

            }




        }
        
    }
}
